import Cookies from 'js-cookie'

const TokenKey = 'token'
const UserNameKey = 'userName'
const UnreadKey = 'unread'
const MenuKey = 'localMenu'
const BtnKey = 'localBtn'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getName() {
  return Cookies.get(UserNameKey)
}

export function setName(name) {
  return Cookies.set(UserNameKey, name)
}
export function getUnread() {
  return Cookies.get(UnreadKey)
}

export function setUnread(unread) {
  return Cookies.set(UnreadKey, unread)
}

export function removeName() {
  return Cookies.remove(UserNameKey)
}

export function getLocalMenu() {
  return window.localStorage.getItem(MenuKey)
}

export function setLocalMenu(menu) {
  return window.localStorage.setItem(MenuKey, menu)
}

export function removeLocalMenu(menu) {
  return window.localStorage.removeItem(MenuKey)
}

export function getLocalBtn() {
  return window.localStorage.getItem(BtnKey)
}

export function setLocalBtn(btn) {
  return window.localStorage.setItem(BtnKey, btn)
}

export function removeLocalBtn(btn) {
  return window.localStorage.removeItem(BtnKey)
}

